package com.qf.bank.dealapi.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.bank.dealapi.fallback.DealApiError;
import com.qf.bank.dealapi.po.TransferAccounts;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: bank
 * @description: 交易记录
 * @author: 徐毫杰
 * @create: 2019-12-06 21:17
 **/
@FeignClient(value = "deal-provider", fallback = DealApiError.class)
public interface DealApi {
    /**
     * 分页
     */
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public Page<TransferAccounts> page(@RequestParam int current, @RequestParam int size);
    /**
     * 增加转账记录
     */
    @RequestMapping(value = "/", method = RequestMethod.POST)
    public Boolean setInsert(@RequestBody TransferAccounts transferAccounts);
    /**
     * 删除转账记录
     */
    @RequestMapping(value = "/{transferAccountsId}", method = RequestMethod.DELETE)
    public Boolean getDeleteId(@PathVariable(value = "transferAccountsId") int transferAccountsId);
    /**
     * 删除多个转账
     */
    @RequestMapping(value = "/",method = RequestMethod.DELETE)
    public Boolean getDelete(@RequestBody List<Integer> list);
    /**
     * 修改转账记录
     */
    @RequestMapping(value = "/", method = RequestMethod.PATCH)
    public Boolean getChangeId(@RequestBody TransferAccounts transferAccounts);
    /**
     * 查询转账记录
     */
    @RequestMapping(value = "/{transferAccountsId}", method = RequestMethod.GET)
    public TransferAccounts getById(@PathVariable(value = "transferAccountsId") int transferAccountsId);
}
